/**
 * Copyright &copy; 2016-2017 <a href="https://www.lczyfz.com">联创智云</a> All rights reserved.
 */
package com.lczyfz.campusinfo.modules.user.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lczyfz.campusinfo.common.persistence.Page;
import com.lczyfz.campusinfo.common.service.CrudService;
import com.lczyfz.campusinfo.modules.user.entity.CampusinfoUserGroup;
import com.lczyfz.campusinfo.modules.user.dao.CampusinfoUserGroupDao;

/**
 * 用户组别管理Service
 * @author 陈维乾
 * @version 2018-03-31
 */
@Service
@Transactional(readOnly = true)
public class CampusinfoUserGroupService extends CrudService<CampusinfoUserGroupDao, CampusinfoUserGroup> {

	@Autowired
	private	CampusinfoUserGroupDao campusinfoUserGroupDao;
	
	public CampusinfoUserGroup get(String id) {
		return super.get(id);
	}
	
	public List<CampusinfoUserGroup> findList(CampusinfoUserGroup campusinfoUserGroup) {
		return super.findList(campusinfoUserGroup);
	}
	
	public Page<CampusinfoUserGroup> findPage(Page<CampusinfoUserGroup> page, CampusinfoUserGroup campusinfoUserGroup) {
		return super.findPage(page, campusinfoUserGroup);
	}
	
	@Transactional(readOnly = false)
	public void save(CampusinfoUserGroup campusinfoUserGroup) {
		super.save(campusinfoUserGroup);
	}
	
	@Transactional(readOnly = false)
	public void delete(CampusinfoUserGroup campusinfoUserGroup) {
		super.delete(campusinfoUserGroup);
	}
	
	@Transactional(readOnly = false)
	public void deleteByUseridAndGroupid(String userid,String groupid){
		campusinfoUserGroupDao.deleteByUseridAndGroupid(userid,groupid);
	}
	//通过userid 删除UserGroup信息
	@Transactional(readOnly = false)
	public  void deleteByUserid(String userId){
		campusinfoUserGroupDao.deleteByUserid(userId);
	}

	public int isUniqueness(CampusinfoUserGroup campusinfoUserGroup){
		return campusinfoUserGroupDao.isUniqueness(campusinfoUserGroup);
	}


}